package com.datastructure.test.overlaprec;

import java.util.ArrayList;

public class OverlapRec {

    public static void main(String[] args) {

    }

    public boolean overlapRec (ArrayList<Integer> r1, ArrayList<Integer> r2) {
        // write code here
        int x11 = r1.get(0);
        int y11 = r1.get(1);
        int x12 = r1.get(2);
        int y12 = r1.get(3);
        int x21 = r2.get(0);
        int y21 = r2.get(1);
        int x22 = r2.get(2);
        int y22 = r2.get(3);
        if (x11 >= x22 || y11 >= y22) {
            return false;
        }
        return x12 > x21 && y12 > y21;
    }
}
